function ajax1(method,url,data,success,error){
	var xml = new XMLHttpRequest()||new ActiveXObject("Microsoft,XMLHTTP");
	//打开方式
	method = method.toUpperCase();
	xml.open(method,url);
	xml.setRequestHeader("Content-type","application/x-www-form-urlencoded");
	if(data){
		xml.send(data);
	}else{
		xml.send();
	}
	xml.onreadystatechange = function(){
		if(xml.readyState==4){
			if(xml.status==200){
				success(xml.responseText);
			}else{
				error(xml.status);
			}
		}
	}
}

function ajax(method,url,data,success,error){
	$.ajax({
		url:url,
		type:method,
		data:data,
		dataType:'json',
		success:function(data){
			success(data)
		},
		error:function(data){
			error(data)
		}
	})
};
$(".purple,.black,.lookup").on("click",function(event){
	event.stopPropagation();
});
function ShowTipBox(){
    var dIv=$("<div class='a-div'><h4 class='a-h4'>提示</h4><p class='a-p'>您确定要<span class='a-span'>删除</span>吗？</p><div class='a-btn'><input type='button' value='确认' class='a-confirm btn-primary'><input type='button' value='取消' class='a-cancel'></div></div>");
    $("body").append(dIv);
};
function ShowTipBoxBegin(){
    var dIv=$("<div class='a-div'><h4 class='a-h4'>提示</h4><p class='a-p'>您确定要<span class='a-span'>激活</span>吗？</p><div class='a-btn'><input type='button' value='确认' class='a-confirm btn-primary'><input type='button' value='取消' class='a-cancel'></div></div>");
    $("body").append(dIv);
};
function ShowTipBoxEnd(){
    var dIv=$("<div class='a-div'><h4 class='a-h4'>提示</h4><p class='a-p'>您确定要<span class='a-span'>暂停</span>吗？</p><div class='a-btn'><input type='button' value='确认' class='a-confirm btn-primary'><input type='button' value='取消' class='a-cancel'></div></div>");
    $("body").append(dIv);
};
function randomNum(){
    return parseInt(100000000+Math.random()*100000000);
};

$('.zhgl').click(function () {
    var phone = 0;
    $.ajax({
            'type':'POST',
            'url':'/withdraw/get-money',
            'data':'',
            'dataType':'json',
            'success':function(data)
            {
                phone = data.data.admin_phone;
                if(data.code == 200){
                    layer.open({
                        id: 1,
                        type: 1,
                        title: '账户密码验证',
                        skin: 'layui-layer-rim',
                        area: ['270px', 'auto'],
                        content: '<div style="margin-top: 20px;margin-left: 5px">' +
                        '<p class="boxtop"><input type="password"  class="txmm"  placeholder="请输入提现密码"   >' +
                        '<p class="txtexts"></p>' +
                        '</div>',
                        btn: ['确认', '忘记密码','取消'],
                        btn1: function (index, layero) {

                        },
                        btn2: function (index, layero) {
                            layer.open({
                                id: 2,
                                type: 1,
                                title: '修改密码',
                                skin: 'layui-layer-rim',
                                area: ['270px', 'auto'],
                                content: '<div style="margin-top: 20px;margin-left: 5px">' +
                                '<p class="boxtop"><input type="password"  class="txmm"  placeholder="请输入新的提现密码"   >' +
                                '<p class="boxtop"><input type="password"  class="txmm"  placeholder="再次输入提现密码"   >' +
                                '<p class="boxtops">验证管理员手机:</p>' +
                                '<p class="boxtops"><input type="test" class="yzm" style="width: 100px" placeholder="请输入手机验证码" onkeydown="xzasdasd(this)"   > <input type="button" onclick="getchecknum()" value="获取验证码" class="getchecknum"></p>' +
                                '<p class="txtexts"></p>' +
                                '</div>',
                                btn: ['确认', '取消'],
                                btn1: function (index, layero) {

                                }
                            })
                        }
                    })
                } else {
                    layer.open({
                        id: 2,
                        type: 1,
                        title: '请设置账户密码',
                        skin: 'layui-layer-rim',
                        area: ['270px', 'auto'],
                        content: '<div style="margin-top: 20px;margin-left: 5px">' +
                        '<p class="boxtop"><input type="password"  class="txmm sztxmm"  placeholder="请输入6位数字密码"   >' +
                        '<p class="boxtop"><input type="password"  class="txmm sztxmms"  placeholder="再次确认密码"   >' +
                        '<p class="boxtops">验证管理员手机:'+phone+'</p>' +
                        '<p class="boxtops"><input type="test" class="yzm" style="width: 100px" placeholder="请输入验证码" onkeydown="xzasdasd(this)"   > <input type="button" onclick="getchecknum()" value="获取验证码" class="getchecknum"></p>' +
                        '<p class="txtexts"></p>' +
                        '</div>',
                        btn: ['确认', '取消'],
                        btn1: function (index, layero) {

                        }
                    })
                }
            }
    })

})

